/********************************************************************

Write Date: 2015/04/20
Author: Apple
>>>> Create class Wrapper
	
Modify Date: 2015/04/21
Author: Apple
>>>> Add document

Modify Date: 2015/05/07
Author: Apple
>>>> Add const qualifier to getDataPtr().

*********************************************************************/
#pragma once
#include "ooputils_global.h"
#include "Object.h"



_NS_OOP_BEGIN



/**
 * Class Wrapper is used to wrap non-Objects and provide the same 
 * reference-counting function as Objects. The non-Object must be created by 
 * new operator and have no references in other places. The non-Object will be 
 * destroied when the Wrapper is destroied.
 *
 * @remarks 2015/04/20, Apple
 */
class Wrapper : public Object
{
public:

	Wrapper ();

	/**
	 * Create a Wrapper to wrap a non-Object.
	 *
	 * @param p_data the non-Object to be wrapped
	 */
	Wrapper (void* p_data);

	/**
	 * Destroy the Wrapper. The non-Object will also be destroied.
	 */
	~Wrapper ();

	/**
	 * Get the normal pointer.
	 *
	 * @return the normal pointer
	 */
	void* getDataPtr () const;

private:

	void* _p_data;

};



_NS_OOP_END